﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace BPM.Web.Shared.Data;

/// <summary>
/// 组织机构表
/// </summary>
public partial class SysOrg : BaseVM
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [DisplayName("业务号")]
    [Required(ErrorMessage = "业务号不能为空")]
    [JsonPropertyName("id")]
    public long Id { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [DisplayName("创建时间")]
    [JsonPropertyName("createdTime")]
    public System.DateTimeOffset? CreatedTime { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [DisplayName("更新时间")]
    [JsonPropertyName("updatedTime")]
    public System.DateTimeOffset? UpdatedTime { get; set; }

    /// <summary>
    /// 创建者Id
    /// </summary>
    [DisplayName("创建者Id")]
    [JsonPropertyName("createdUserId")]
    public long? CreatedUserId { get; set; }

    /// <summary>
    /// 创建者名称
    /// </summary>
    [DisplayName("创建者名称")]
    [JsonPropertyName("createdUserName")]
    [StringLength(20)]
    public string? CreatedUserName { get; set; }

    /// <summary>
    /// 修改者Id
    /// </summary>
    [DisplayName("修改者Id")]
    [JsonPropertyName("updatedUserId")]
    public long? UpdatedUserId { get; set; }

    /// <summary>
    /// 修改者名称
    /// </summary>
    [DisplayName("修改者名称")]
    [JsonPropertyName("updatedUserName")]
    [StringLength(20)]
    public string? UpdatedUserName { get; set; }

    /// <summary>
    /// 租户id
    /// </summary>
    [DisplayName("租户id")]
    [JsonPropertyName("tenantId")]
    public long? TenantId { get; set; }

    /// <summary>
    /// 父Id
    /// </summary>
    [DisplayName("父Id")]
    [JsonPropertyName("pid")]
    public long Pid { get; set; }

    /// <summary>
    /// 父Ids
    /// </summary>
    [DisplayName("父Ids")]
    [JsonPropertyName("pids")]
    public string? Pids { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [DisplayName("名称")]
    [JsonPropertyName("name")]
    [Required(ErrorMessage = "名称不能为空")]
    [StringLength(100)]
    public string? Name { get; set; }

    /// <summary>
    /// 编码
    /// </summary>
    [DisplayName("编码")]
    [JsonPropertyName("code")]
    [Required(ErrorMessage = "编码不能为空")]
    [StringLength(50)]
    public string? Code { get; set; }

    /// <summary>
    /// 联系人
    /// </summary>
    [DisplayName("联系人")]
    [JsonPropertyName("contacts")]
    [StringLength(20)]
    public string? Contacts { get; set; }

    /// <summary>
    /// 电话
    /// </summary>
    [DisplayName("电话")]
    [JsonPropertyName("tel")]
    [StringLength(20)]
    public string? Tel { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [DisplayName("排序")]
    [JsonPropertyName("sort")]
    public int Sort { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [DisplayName("备注")]
    [JsonPropertyName("remark")]
    [StringLength(100)]
    public string? Remark { get; set; }

    [JsonPropertyName("status")]
    public CommonStatus Status { get; set; }

    [JsonPropertyName("orgType")]
    public OrgTypeEnum OrgType { get; set; }

    /// <summary>
    /// 多对多（用户）
    /// </summary>
    [DisplayName("多对多（用户）")]
    [JsonPropertyName("sysUsers")]
    public ICollection<SysUser>? SysUsers { get; set; }

    /// <summary>
    /// 多对多中间表（用户数据范围）
    /// </summary>
    [DisplayName("多对多中间表（用户数据范围）")]
    [JsonPropertyName("sysUserDataScopes")]
    public ICollection<SysUserDataScope>? SysUserDataScopes { get; set; }

    /// <summary>
    /// 多对多（角色）
    /// </summary>
    [DisplayName("多对多（角色）")]
    [JsonPropertyName("sysRoles")]
    public ICollection<SysRole>? SysRoles { get; set; }

    /// <summary>
    /// 多对多中间表（角色数据范围）
    /// </summary>
    [DisplayName("多对多中间表（角色数据范围）")]
    [JsonPropertyName("sysRoleDataScopes")]
    public ICollection<SysRoleDataScope>? SysRoleDataScopes { get; set; }

}
